// 定义游戏玩家类
class GamePlayer {
    //构造函数
    constructor() {
        //成员变量
        this.RoomId = null;
        this.ChairId = "";
        this.PlayerId = "";
        this.PlayerStatus = -1;
        this.PlayerNickName = "";
        this.PlayerHeaderUrl = "";
        this.PlayerSocket = null;
        this.PlayerIsMoving=false;
        //玩家位置x y
        this.PlayerPosition = new Array(2);
        this.PlayerPosition[0]=0.00;
        this.PlayerPosition[1]=0.00;
        //face direct
        this.PlayerDirect = 0;//left=0 right=1
        //is Jump
        this.PlayerIsJumping=false;
        //刚体
        this.body=null;

    }
    setBody(body){
        this.body = body;
    }
    getBody(){
        return this.body;
    }
    GetPlayerId(){
        return this.PlayerId;
    }
    SetPlayerId(PlayerId){
        this.PlayerId = PlayerId;
    }
    GetPlayerStatus(){
        return this.PlayerStatus;
    }
    SetPlayerStatus(PlayerStatus){
        this.PlayerStatus = PlayerStatus;
    }
    GetPlayerNickName(){
        return this.PlayerNickName;
    }
    SetPlayerNickName(PlayerNickName){
        this.PlayerNickName = PlayerNickName;
    }
    GetPlayerHeaderUrl(){
        return this.PlayerHeaderUrl;
    }
    SetPlayerHeaderUrl(PlayerHeaderUrl){
        this.PlayerHeaderUrl = PlayerHeaderUrl;
    }
    GetPlayerSocket(){
        return this.PlayerSocket;
    }
    SetPlayerSocket(PlayerSocket){
        this.PlayerSocket = PlayerSocket;
    }
    GetRoomId(roomId){
        return this.RoomId;
    }
    SetRoomId(roomId){
        this.RoomId = roomId;
    }
    GetChairId(){
        return this.ChairId;
    }
    SetChairId(chairId){
        this.ChairId = chairId;
    }
    GetPlayerIsMoving(){
        return this.PlayerIsMoving;
    }
    SetPlayerIsMoving(IsMoving){
        this.PlayerIsMoving = IsMoving;
    }
    GetPlayerPosition(){
        return this.PlayerPosition;
    }
    SetPlayerPosition(x, y) {
        this.PlayerPosition[0]=x;
        this.PlayerPosition[1]=y;
    }
    GetPlayerDirect(){
        return this.PlayerDirect;
    }
    SetPlayerDirect(PlayerDirect){
        this.PlayerDirect = PlayerDirect;
    }
    GetPlayerIsJumping(){
        return this.PlayerIsJumping;
    }
    SetPlayerIsJumping(IsJumping){
        this.PlayerIsJumping = IsJumping;
    }
    

}
module.exports = GamePlayer;